home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / AppleShare IP SDK / ASIP Server Controls⁄Events / Headers / AppleShareFileServerControl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-21  |  34.1 KB  |  1,056 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        AppleShareFileServerControl.h
  3.  
  4.      Contains:    Interface definitions for Server Control calls, and Server Event constants;
  5.  
  6.      Version:    Technology:    AppleShare IP 6.0
  7.                  Release:    ASIP 6.2 SDK - Friday, April 2, 1999 9:36:27 AM
  8.  
  9.      Copyright:    © 1995-1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __APPLESHAREFILESERVERCONTROL__
  18. #define __APPLESHAREFILESERVERCONTROL__
  19.  
  20. #ifndef __APPLETALK__
  21. #include <AppleTalk.h>
  22. #endif
  23.  
  24. #ifndef __FILES__
  25. #include <Files.h>
  26. #endif
  27.  
  28. #ifndef __MIXEDMODE__
  29. #include <MixedMode.h>
  30. #endif
  31.  
  32. #ifndef __TRAPS__
  33. #include <Traps.h>
  34. #endif
  35.  
  36.  
  37.  
  38.  
  39. #if PRAGMA_ONCE
  40. #pragma once
  41. #endif
  42.  
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46.  
  47. #if PRAGMA_IMPORT
  48. #pragma import on
  49. #endif
  50.  
  51. #if PRAGMA_STRUCT_ALIGN
  52.     #pragma options align=mac68k
  53. #elif PRAGMA_STRUCT_PACKPUSH
  54.     #pragma pack(push, 2)
  55. #elif PRAGMA_STRUCT_PACK
  56.     #pragma pack(2)
  57. #endif
  58.  
  59. /* Server Control Codes ---------------------------------------------------------------------------- */
  60. enum {
  61.     kSCStartServer                = 0,                            /* Use StartParam variant */
  62.     kSCShutDown                    = 2,                            /* Use DisconnectParam variant */
  63.     kSCCancelShutDown            = 3,                            /* Use DisconnectParam variant */
  64.     kSCDisconnect                = 4,                            /* Use DisconnectParam variant */
  65.     kSCPollServer                = 5,                            /* Use PollServerParam variant */
  66.     kSCGetExpFldr                = 6,                            /* Use StandardParam variant */
  67.     kSCGetSetupInfo                = 7,                            /* Use SetupParam variant */
  68.     kSCSetSetupInfo                = 8,                            /* Use SetupParam variant */
  69.     kSCSendMessage                = 9,                            /* Use DisconnectParam variant */
  70.     kSCGetServerStatus            = 10,                            /* Use StatusParam variant */
  71.     kSCInstallServerEventProc    = 11,                            /* Use ServerEventParam variant */
  72.     kSCRemoveServerEventProc    = 12,                            /* Use ServerEventParam variant */
  73.     kSCGetServerEventProc        = 13,                            /* Use ServerEventParam variant */
  74.     kSCServerVersion            = 14,                            /* Use VersionParam variant */
  75.     kSCSetCopyProtect            = 16,                            /* Use StandardParam variant */
  76.     kSCClrCopyProtect            = 17,                            /* Use StandardParam variant */
  77.     kSCDisconnectVolUsers        = 18,                            /* Use DisconnectParam variant */
  78.     kSCGetUserNameRec            = 19,                            /* Use UserInfoParam variant */
  79.     kSCGetUserMountInfo            = 20,                            /* Use VolMountedParam variant */
  80.     kSCWakeServer                = 21,                            /* Use StartParam variant */
  81.     kSCSleepServer                = 22,                            /* Use DisconnectParam variant */
  82.     kSCGetCacheStats            = 23,                            /* Use GetCacheStatsParam variant */
  83.     kSCResetCache                = 31,                            /* Use ResetCacheParam variant */
  84.     kSCGetExtUserNameRec        = 35,                            /* Use ExtUserInfoParam variant */
  85.     kSCServiceStateInfo            = 38,                            /* Use ServiceStateParam variant */
  86.     kSCGetPlugInInfo            = 41,                            /* Use PlugInInfoParam variant */
  87.     kSCGetPlugInMimeType        = 42,                            /* Use PlugInMimeTypeParam variant */
  88.     kSCSetHistorySampleTime        = 43,                            /* Use SetHistoryParam variant */
  89.     kSCGetServerActivityHistory    = 44,                            /* Use GetHistoryParam variant*/
  90.     kSCGetSMBConfig                = 46,                            /* Use SMBConfigParam variant*/
  91.     kSCBlockGetUserList            = 47                            /* Use BlockUserRecParam variant*/
  92. };
  93.  
  94. /* General Constants ------------------------------------------------------------------------------- */
  95. /* PollServer scServerState responses... */
  96. enum {
  97.     kSCPollRunning                = -1,
  98.     kSCPollStartingUp            = -2,
  99.     kSCPollJustDisabled            = -3,
  100.     kSCPollDisabledErr            = -4,
  101.     kSCPollSleeping                = -5
  102. };
  103.  
  104. /* PollServer scDisconnectState responses... */
  105. enum {
  106.     kSCNotDisconnecting            = -1,
  107.     kSCDisconnectWithin29Secs    = 0,
  108.     kSCDisconnect30To89Secs        = 1                                /* Any other value is the number of minutes remaining, rounded... */
  109. };
  110.  
  111. /* PollServer scServerErrors responses... */
  112. enum {
  113.     kSCModernMemMgrOffErr        = 1,                            /* Must run with Modern Memory Manager */
  114.     kSCNoThreadLibraryErr        = 2,
  115.     kSCServiceNotInstalledErr    = 3,
  116.     kSCInsuffMFMemErr            = 4,
  117.     kSCCantRegNameErr            = 5,
  118.     kSCCantFindExtnFolderErr    = 6,
  119.     kSCUnExATalkErr                = 7,
  120.     kSCNoMachineNameErr            = 8,
  121.     kSCCantFindFSExtnErr        = 9,
  122.     kSCATalkOffErr                = 10,
  123.     kSCNoInitRunErr                = 12,
  124.     kSCInsuffAppMemErr            = 14,
  125.     kSCBadConfigErr                = 15,
  126.     kSCNoDTOnStartupErr            = 16,
  127.     kSCDupNameErr                = 17,
  128.     kSCBadFileBufParmsErr        = 19,
  129.     kSCNeedRootUserErr            = 20,                            /* The range 21-28 are reserved for future use by Apple. */
  130.     kSCBadSerialNumErr            = 29,
  131.     kSCSysTooOldErr                = 34,
  132.     kSCDupSerialNumberErr        = 36,                            /* NBP dup serial number detected */
  133.     kSCVMOnErr                    = 37,                            /* Virtual Memory is turned on on server machine */
  134.     kSCNoPPCErr                    = 38,                            /* Server only runs on a ppc machine */
  135.     kSCBadInitErr                = 39,
  136.     kSCOpenTransportInstallErr    = 40,                            /* Incompatible version of Open Transport */
  137.     kSCNoAgentLibErr            = 41,                            /* No ASRLib */
  138.     kSCNoAgentSessionErr        = 42,                            /* Could not open an agent session */
  139.     kSCInvalidAgentErr            = 43,                            /* No agent or a problem with the agent */
  140.     kSCAgentServerObjErr        = 44,                            /* Bad server object type. */
  141.     kSCAgentGenesisErr            = 46,
  142.     kSCAlreadyShuttingDown        = -1,
  143.     kSCAlreadyDisconnecting        = -2,
  144.     kSCDeletedPDSErr            = -2,
  145.     kSCContainsExpFolderErr        = -3,
  146.     kSCCantPrepareVolumeErr        = -4,
  147.     kSCTooManyExpFoldersErr        = -5,
  148.     kSCFixedPDSErr                = -6,
  149.     kSCExpFolderNamConfErr        = -7,
  150.     kSCNoExportFolderErr        = -8,
  151.     kSCInsideExpFolderErr        = -9,
  152.     kSCInsideTrashErr            = -10,
  153.     kSCVolNameConflictErr        = -11,
  154.     kSCCacheReducedErr            = -12,
  155.     kSCBadIPConfigErr            = -20,
  156.     kSCBadAccessPrivRecErr        = -21,
  157.     kSCBadMimeTypeFileErr        = -22,
  158.     kSCDuplicateVolumeErr        = -23,                            /* Second volume with same name will not be shared */
  159.                                                                 /* -100 to -199 are AFP errors */
  160.     kSCAFPGenErr                = -100,
  161.     kSCAFPTCPGenErr                = -150,
  162.     kSCAFPTCPMemErr                = -151,
  163.     kSCAFPTCPPortInUseErr        = -152,                            /* -200 to -299 are FTP errors */
  164.     kSCFTPGenErr                = -200,
  165.     kSCFTPPortInUseErr            = -201,
  166.     kSCFTPNotAvailErr            = -202,
  167.     kSCFTPMemErr                = -203,                            /* -300 to -399 are Web errors */
  168.     kSCHTTPGenErr                = -300,
  169.     kSCHTTPPortInUseErr            = -302,
  170.     kSCHTTPFolderErr            = -303,
  171.     kSCHTTPFileErr                = -304,
  172.     kSCHTTPMemErr                = -305,
  173.     kSCHTTPNoMimeTypesErr        = -306,
  174.     kSCHTTPNoDefaultMimeErr        = -307,
  175.     kSCPluginDirNotFoundErr        = -308,
  176.     kSCPluginMemFullErr            = -309,
  177.     kSCPluginPreProcNotFoundErr    = -310,
  178.     kSCPluginPostProcNotFoundErr = -311,
  179.     kSCErrorPluginNotFoundErr    = -312,
  180.     kSCPluginNotPreProcessorErr    = -313,
  181.     kSCPluginNotPostProcessorErr = -314,
  182.     kSCPluginMemPoolFullErr        = -315,
  183.     kSCPluginOutOfMemoryErr        = -316,
  184.     kSCCorruptedMimeTypesErr    = -317,
  185.     kSCPlugInLoggingErr            = -318,
  186.     kSCPlugInTypeConflictErr    = -319,
  187.     kSCPlugInCannotRegisterErr    = -320,
  188.     kSCPlugInMemSmallErr        = -321,
  189.     kSCWebAdminNetworkErr        = -330,                            /* -400 to -499 are SMB errors  */
  190.     kSCSMBGenErr                = -400,
  191.     kSCSMBPortInUseErr            = -402,
  192.     kSCSMBMemErr                = -405
  193. };
  194.  
  195. /* Define times for shutdown... */
  196. enum {
  197.     kSCMaxTimer                    = 4094,
  198.     kSCMinTimer                    = 0
  199. };
  200.  
  201. /* Plugin errors (PlugInMimeTypeParam, PlugInInfoParam)... */
  202. enum {
  203.     kSCPlugInNoErr                = 0,
  204.     kSCPlugInWrongVersionErr    = 1,
  205.     kSCPlugInBadIndexErr        = 2,
  206.     kSCPlugInPlugInsNotLoadedErr = 3,
  207.     kSCPlugInBadPlugInRefErr    = 4
  208. };
  209.  
  210. /* Plugin info dimensions (C-strings)... */
  211. enum {
  212.     kSCPlugInNameSize            = 32,
  213.     kSCPlugInAdminURLSize        = 256,
  214.     kSCPlugInVersionStrSize        = 12,
  215.     kSCMimeTypeSize                = 80,
  216.     kSCSuffixSize                = 32
  217. };
  218.  
  219. /* Number of samples in ServerHistoryRec... */
  220. enum {
  221.     kSCMaxDataPoints            = 1024
  222. };
  223.  
  224. /* For siVersion field of SetupInfoRec...*/
  225. enum {
  226.     kSCSetUpRecordVersion        = 3
  227. };
  228.  
  229. /* VersionParam's scServerType contains the server type, which is interpreted as follows: */
  230. enum {
  231.     kSCMFSServerType            = 0x0000,                        /* Macintosh File Sharing */
  232.     kSCAFSServerType            = 0x0001                        /* AppleShare/AppleShare IP File Server */
  233. };
  234.  
  235. #ifndef SCCACHESTATSRECVERS3
  236. #define SCCACHESTATSRECVERS3 1
  237. /* For csVersion field of SCCacheStatsRec... */
  238. enum {
  239.     kSCCacheStatsRecVersion        = 3
  240. };
  241.  
  242. #endif  /* !defined(SCCACHESTATSRECVERS3) */
  243.  
  244. /* Current version number of scFileInfoRec block... */
  245. enum {
  246.     kSCFileInfoRecVersion        = 1
  247. };
  248.  
  249. /* Parameters for the "bitmap" field of ResetCacheParam... */
  250. enum {
  251.     kSCResetFileCache            = 0x0001,
  252.     kSCResetCNodeCache            = 0x0002,
  253.     kSCResetDTCache                = 0x0004,
  254.     kSCShrinkCache                = 0x8000,
  255.     kSCShrinkAllCaches            = 0x8007
  256. };
  257.  
  258. /* For attrVersion field of ExtUserInfoParam... */
  259. enum {
  260.     kSCOldUserAttrRecVersion    = 0,
  261.     kSCUserAttrRecVersion        = 1
  262. };
  263.  
  264. /* Current session layers for scProtocolType field of UserAttrRec... */
  265. enum {
  266.     kSCSessionInvalid            = 0x0000,
  267.     kSCSessionAll                = FOUR_CHAR_CODE('alls'),
  268.     kSCSessionAFP                = FOUR_CHAR_CODE('afp '),
  269.     kSCSessionHTTP                = FOUR_CHAR_CODE('http'),
  270.     kSCSessionFTP                = FOUR_CHAR_CODE('ftp '),
  271.     kSCSessionSMB                = FOUR_CHAR_CODE('smb '),
  272.     kSCSessionNFS                = FOUR_CHAR_CODE('nfs ')
  273. };
  274.  
  275. /* Current transport layers for scTransportType field of UserAttrRec... */
  276. enum {
  277.     kSCTransportATP                = FOUR_CHAR_CODE('atp '),
  278.     kSCTransportTCP                = FOUR_CHAR_CODE('tcp ')
  279. };
  280.  
  281. /* For version field of PlugInInfoParam... */
  282. enum {
  283.     kSCPlugInInfoParamVersion    = 0
  284. };
  285.  
  286. /* For plugInAttributes field of PlugInInfoParam... */
  287. enum {
  288.     kSCAttPreProcessor            = 0x00000001,                    /* works as a preprocessor */
  289.     kSCAttPostProcessor            = 0x00000002,                    /* works as a postprocessor */
  290.     kSCAttFilter                = 0x00000004,                    /* works as filter */
  291.     kSCAttAccessControl            = 0x00000008,                    /* works as access control */
  292.     kSCAttErrorProcessor        = 0x00000010                    /* works as error processor */
  293. };
  294.  
  295. /* Current version number of SCSrvrMsgsRec... */
  296. enum {
  297.     kSCSrvrMsgsRecVersion        = 1
  298. };
  299.  
  300. /* For version field of PlugInMimeTypeParam... */
  301. enum {
  302.     kSCPlugInMimeTypeParamVersion = 0
  303. };
  304.  
  305. /* For version field of BlockUserRecParam...*/
  306. enum {
  307.     kSCBlockGetUserRecVersion    = 1
  308. };
  309.  
  310. /* Other service states...*/
  311. enum {
  312.     kSCFTPServiceBit            = 0x01,
  313.     kSCSMBServiceBit            = 0x02
  314. };
  315.  
  316. /* Misc params...*/
  317. enum {
  318.     kSCCurrentlyInstalled        = 0,
  319.     kSCUseFinderExtension        = 0,
  320.     kSCStartingEntity            = 1,
  321.     kSCStartingExtension        = 2,
  322.     kSCUseMessagePtr            = 1
  323. };
  324.  
  325. /* Server Control Data Structures ------------------------------------------------------------------ */
  326. /*
  327.    Since all calls are made through ServerDispatchSync, ioCompletion is ignored, so this is for
  328.    completeness only..., 
  329. */
  330. typedef UniversalProcPtr                 SCCompletionUPP;
  331.  
  332. struct StartParam {
  333.     QElemPtr                         qLink;                        /*queue link in header*/
  334.     SInt16                             qType;                        /*type byte for safety check*/
  335.     SInt16                             ioTrap;                        /*FS: the Trap*/
  336.     Ptr                             ioCmdAddr;                    /*FS: address to dispatch to*/
  337.     SCCompletionUPP                 ioCompletion;                /*completion routine addr (0 for synch calls)*/
  338.     OSErr                             ioResult;                    /*result code*/
  339.     SInt32                             reserved;
  340.     SInt16                             reserved2;
  341.     SInt16                             reserved3;
  342.     SInt16                             scCode;
  343.     SInt16                             scStartSelect;
  344.     SInt16                             scEventSelect;
  345.     SInt32                             scWhere;
  346.     SInt32                             scReceiverID;
  347.     SInt32                             scDataType;
  348.     SInt32                             scStartOptions;
  349. };
  350. typedef struct StartParam                StartParam;
  351. typedef StartParam *                    StartParamPtr;
  352.  
  353. struct DisconnectParam {
  354.     QElemPtr                         qLink;                        /*queue link in header*/
  355.     SInt16                             qType;                        /*type byte for safety check*/
  356.     SInt16                             ioTrap;                        /*FS: the Trap*/
  357.     Ptr                             ioCmdAddr;                    /*FS: address to dispatch to*/
  358.     SCCompletionUPP                 ioCompletion;                /*completion routine addr (0 for synch calls)*/
  359.     OSErr                             ioResult;                    /*result code*/
  360.     SInt32 *                        scDiscArrayPtr;
  361.     SInt16                             scArrayCount;
  362.     SInt16                             reserved;
  363.     SInt16                             scCode;
  364.     SInt16                             scNumMinutes;
  365.     SInt16                             scFlags;
  366.     StringPtr                         scMessagePtr;
  367. };
  368. typedef struct DisconnectParam            DisconnectParam;
  369. typedef DisconnectParam *                DisconnectParamPtr;
  370.  
  371. struct PollServerParam {
  372.     QElemPtr                         qLink;                        /*queue link in header*/
  373.     SInt16                             qType;                        /*type byte for safety check*/
  374.     SInt16                             ioTrap;                        /*FS: the Trap*/
  375.     Ptr                             ioCmdAddr;                    /*FS: address to dispatch to*/
  376.     SCCompletionUPP                 ioCompletion;                /*completion routine addr (0 for synch calls)*/
  377.     OSErr                             ioResult;                    /*result code*/
  378.     SInt32                             reserved;
  379.     SInt16                             reserved2;
  380.     SInt16                             reserved3;
  381.     SInt16                             scCode;
  382.     SInt16                             scServerState;
  383.     SInt16                             scDisconnectState;
  384.     SInt16                             scServerError;
  385.     SInt32                             scSecondsLeft;
  386. };
  387. typedef struct PollServerParam            PollServerParam;
  388. typedef PollServerParam *                PollServerParamPtr;
  389.  
  390. struct StandardParam {
  391.     QElemPtr                         qLink;                        /*queue link in header*/
  392.     SInt16                             qType;                        /*type byte for safety check*/
  393.     SInt16                             ioTrap;                        /*FS: the Trap*/
  394.     Ptr                             ioCmdAddr;                    /*FS: address to dispatch to*/
  395.     SCCompletionUPP                 ioCompletion;                /*completion routine addr (0 for synch calls)*/
  396.     OSErr                             ioResult;                    /*result code*/
  397.     StringPtr                         scNamePtr;
  398.     SInt16                             scVRefNum;
  399.     SInt16                             scLogins;
  400.     SInt16                             scCode;
  401.     SInt16                             scIndex;
  402.     SInt32                             scDirID;
  403. };
  404. typedef struct StandardParam            StandardParam;
  405. typedef StandardParam *                    StandardParamPtr;
  406.  
  407. typedef unsigned char                     Str198[199];
  408.  
  409. struct SetupInfoRec {
  410.     SInt16                             siVersion;
  411.     SInt16                             siFlags;
  412.     SInt16                             siMaxLogins;
  413.     SInt16                             siSrvrUsageLimit;
  414.     Point                             siVolInfoLocation;
  415.     Boolean                         siVolInfoVisible;
  416.     Boolean                         siReserved1;
  417.     Point                             siUserInfoLocation;
  418.     Boolean                         siUserInfoVisible;
  419.     Boolean                         siReserved2;
  420.     SInt16                             siShutDownMins;
  421.     SInt16                             siCacheControl;                /* no longer used */
  422.     SInt16                             siVolParmsStepSize;
  423.     SInt16                             siVolParmsIncrement;
  424.     SInt16                             siVolParmsFirstDelay;
  425.     SInt16                             siVolParmsMaxDelay;
  426.     SInt32                             siRACacheFileBufSize;        /* no longer used */
  427.     SInt32                             siRACacheSize;                /* no longer used */
  428.     SInt16                             siDirCacheMaxWidth;            /* no longer used */
  429.     SInt32                             siDirCacheSize;                /* no longer used */
  430.     SInt32                             siIconCacheSize;            /* no longer used */
  431.     SInt32                             siBTMemReservedFromCache;
  432.     SInt16                             siSpare[1];                    /* reserved */
  433.     Str198                             siLoginMsg;
  434. };
  435. typedef struct SetupInfoRec                SetupInfoRec;
  436.  
  437. typedef SetupInfoRec *                    SetupInfoPtr;
  438.  
  439. struct SetupParam {
  440.     QElemPtr                         qLink;                        /*queue link in header*/
  441.     SInt16                             qType;                        /*type byte for safety check*/
  442.     SInt16                             ioTrap;                        /*FS: the Trap*/
  443.     Ptr                             ioCmdAddr;                    /*FS: address to dispatch to*/
  444.     SCCompletionUPP                 ioCompletion;                /*completion routine addr (0 for synch calls)*/
  445.     OSErr                             ioResult;                    /*result code*/
  446.     SetupInfoPtr                     scSetupPtr;
  447.     SInt16                             scMaxVolumes;
  448.     SInt16                             scMaxExpFolders;
  449.     SInt16                             scCode;
  450.     SInt16                             scCurMaxSessions;
  451. };
  452. typedef struct SetupParam                SetupParam;
  453. typedef SetupParam *                    SetupParamPtr;
  454.  
  455. struct StatusParam {
  456.     QElemPtr                         qLink;                        /*queue link in header*/
  457.     SInt16                             qType;                        /*type byte for safety check*/
  458.     SInt16                             ioTrap;                        /*FS: the Trap*/
  459.     Ptr                             ioCmdAddr;                    /*FS: address to dispatch to*/
  460.     SCCompletionUPP                 ioCompletion;                /*completion routine addr (0 for synch calls)*/
  461.     OSErr                             ioResult;                    /*result code*/
  462.     StringPtr                         scNamePtr;
  463.     SInt16                             reserved2;
  464.     SInt16                             reserved3;
  465.     SInt16                             scCode;
  466.     SInt16                             scServerFlags;
  467.     SInt16                             scNumSessions;
  468.     SInt32                             scUserListModDate;
  469.     SInt16                             scActivity;
  470.     SInt32                             scVolListModDate;
  471. };
  472. typedef struct StatusParam                StatusParam;
  473. typedef StatusParam *                    StatusParamPtr;
  474.  
  475. struct ServerEventParam {
  476.     QElemPtr                         qLink;                        /*queue link in header*/
  477.     SInt16                             qType;                        /*type byte for safety check*/
  478.     SInt16                             ioTrap;                        /*FS: the Trap*/
  479.     Ptr                             ioCmdAddr;                    /*FS: address to dispatch to*/
  480.     SCCompletionUPP                 ioCompletion;                /*completion routine addr (0 for synch calls)*/
  481.     OSErr                             ioResult;                    /*result code*/
  482.     Ptr                             scSEQEntryPtr;
  483.     SInt16                             reserved2;
  484.     SInt16                             reserved3;
  485.     SInt16                             scCode;
  486. };
  487. typedef struct ServerEventParam            ServerEventParam;
  488. typedef ServerEventParam *                ServerEventParamPtr;
  489.  
  490. struct VersionParam {
  491.     QElemPtr                         qLink;                        /*queue link in header*/
  492.     SInt16                             qType;                        /*type byte for safety check*/
  493.     SInt16                             ioTrap;                        /*FS: the Trap*/
  494.     Ptr                             ioCmdAddr;                    /*FS: address to dispatch to*/
  495.     SCCompletionUPP                 ioCompletion;                /*completion routine addr (0 for synch calls)*/
  496.     OSErr                             ioResult;                    /*result code*/
  497.     StringPtr                         scExtNamePtr;
  498.     SInt16                             reserved2;
  499.     SInt16                             reserved3;
  500.     SInt16                             scCode;
  501.     SInt16                             scServerType;
  502.     SInt16                             scServerVersion;
  503. };
  504. typedef struct VersionParam                VersionParam;
  505. typedef VersionParam *                    VersionParamPtr;
  506.  
  507. struct UserInfoParam {
  508.     QElemPtr                         qLink;                        /*queue link in header*/
  509.     SInt16                             qType;                        /*type byte for safety check*/
  510.     SInt16                             ioTrap;                        /*FS: the Trap*/
  511.     Ptr                             ioCmdAddr;                    /*FS: address to dispatch to*/
  512.     SCCompletionUPP                 ioCompletion;                /*completion routine addr (0 for synch calls)*/
  513.     OSErr                             ioResult;                    /*result code*/
  514.     StringPtr                         scNamePtr;
  515.     SInt16                             reserved2;
  516.     SInt16                             reserved3;
  517.     SInt16                             scCode;
  518.     SInt32                             scPosition;
  519.     SInt32                             scUNRecID;
  520.     SInt32                             scUserID;
  521.     SInt32                             scLoginTime;
  522.     SInt32                             scLastUseTime;
  523.     SInt32                             scSocketNum;
  524. };
  525. typedef struct UserInfoParam            UserInfoParam;
  526. typedef UserInfoParam *                    UserInfoParamPtr;
  527.  
  528. struct VolMountedParam {
  529.     QElemPtr                         qLink;                        /*queue link in header*/
  530.     SInt16                             qType;                        /*type byte for safety check*/
  531.     SInt16                             ioTrap;                        /*FS: the Trap*/
  532.     Ptr                             ioCmdAddr;                    /*FS: address to dispatch to*/
  533.     SCCompletionUPP                 ioCompletion;                /*completion routine addr (0 for synch calls)*/
  534.     OSErr                             ioResult;                    /*result code*/
  535.     Ptr                             reserved;
  536.     SInt16                             scVRefNum;
  537.     SInt16                             reserved3;
  538.     SInt16                             scCode;
  539.     SInt16                             scFilesOpen;
  540.     SInt16                             scWriteableFiles;
  541.     SInt32                             scUNRecID;
  542.     Boolean                         scMounted;
  543.     Boolean                         scMountedAsOwner;
  544. };
  545. typedef struct VolMountedParam            VolMountedParam;
  546. typedef VolMountedParam *                VolMountedParamPtr;
  547.  
  548. struct SCCacheStatsRec {
  549.     SInt16                             csVersion;
  550.     SInt32                             csCacheTime;
  551.     SInt32                             csRACacheAttempts;            /* file cache */
  552.     SInt32                             csRACacheHits;
  553.     SInt32                             csRACacheTotalEntries;
  554.     SInt32                             csRACacheEntriesInUse;
  555.     SInt32                             csRACacheEntrySize;
  556.     SInt32                             csDirCacheAttempts;            /* dir cache */
  557.     SInt32                             csDirCacheHits;
  558.     SInt32                             csDirCacheTotalEntries;
  559.     SInt32                             csDirCacheEntriesInUse;
  560.     SInt32                             csDirCacheEntrySize;
  561.     SInt32                             csIconCacheAttempts;        /* dt cache */
  562.     SInt32                             csIconCacheHits;
  563.     SInt32                             csIconCacheTotalEntries;
  564.     SInt32                             csIconCacheEntriesInUse;
  565.     SInt32                             csIconCacheEntrySize;
  566.     SInt32                             csACtlCacheAttempts;        /* PDS info, part of dir cache */
  567.     SInt32                             csACtlCacheHits;
  568.     SInt32                             csACtlCacheTotalEntries;
  569.     SInt32                             csACtlCacheEntriesInUse;
  570.     SInt32                             csACtlCacheEntrySize;
  571.     SInt32                             csAUXCacheAttempts;            /* not used */
  572.     SInt32                             csAUXCacheHits;
  573.     SInt32                             csAUXCacheTotalEntries;
  574.     SInt32                             csAUXCacheEntriesInUse;
  575.     SInt32                             csAUXCacheEntrySize;
  576.                                                                 /*  New fields for version 3 record*/
  577.     SInt32                             csEnumCacheAttempts;
  578.     SInt32                             csEnumCacheHits;
  579.     SInt32                             csEnumCacheTotalEntries;
  580.     SInt32                             csEnumCacheEntriesInUse;
  581.     SInt32                             csEnumCacheEntrySize;
  582.     SInt32                             csMaxFBUsed;
  583.     SInt32                             csSkipPrsAttempts;
  584.     SInt32                             csSkipPrsHits;
  585. };
  586. typedef struct SCCacheStatsRec            SCCacheStatsRec;
  587. typedef SCCacheStatsRec *                SCCacheStatsRecPtr;
  588.  
  589. struct SCOldCacheStatsRec {
  590.     SInt16                             csVersion;
  591.     SInt32                             csCacheTime;
  592.     SInt32                             csRACacheAttempts;            /* file cache */
  593.     SInt32                             csRACacheHits;
  594.     SInt32                             csRACacheTotalEntries;
  595.     SInt32                             csRACacheEntriesInUse;
  596.     SInt32                             csRACacheEntrySize;
  597.     SInt32                             csDirCacheAttempts;            /* dir cache */
  598.     SInt32                             csDirCacheHits;
  599.     SInt32                             csDirCacheTotalEntries;
  600.     SInt32                             csDirCacheEntriesInUse;
  601.     SInt32                             csDirCacheEntrySize;
  602.     SInt32                             csIconCacheAttempts;        /* dt cache */
  603.     SInt32                             csIconCacheHits;
  604.     SInt32                             csIconCacheTotalEntries;
  605.     SInt32                             csIconCacheEntriesInUse;
  606.     SInt32                             csIconCacheEntrySize;
  607.     SInt32                             csACtlCacheAttempts;        /* PDS info, part of dir cache */
  608.     SInt32                             csACtlCacheHits;
  609.     SInt32                             csACtlCacheTotalEntries;
  610.     SInt32                             csACtlCacheEntriesInUse;
  611.     SInt32                             csACtlCacheEntrySize;
  612.     SInt32                             csAUXCacheAttempts;            /* not used */
  613.     SInt32                             csAUXCacheHits;
  614.     SInt32                             csAUXCacheTotalEntries;
  615.     SInt32                             csAUXCacheEntriesInUse;
  616.     SInt32                             csAUXCacheEntrySize;
  617. };
  618. typedef struct SCOldCacheStatsRec        SCOldCacheStatsRec;
  619. typedef SCOldCacheStatsRec *            SCOldCacheStatsRecPtr;
  620.  
  621. struct GetCacheStatsParam {
  622.     QElemPtr                         qLink;                        /*queue link in header*/
  623.     SInt16                             qType;                        /*type byte for safety check*/
  624.     SInt16                             ioTrap;                        /*FS: the Trap*/
  625.     Ptr                             ioCmdAddr;                    /*FS: address to dispatch to*/
  626.     SCCompletionUPP                 ioCompletion;                /*completion routine addr (0 for synch calls)*/
  627.     OSErr                             ioResult;                    /*result code*/
  628.     Ptr                             reserved;
  629.     SInt16                             reserved2;
  630.     SInt16                             reserved3;
  631.     SInt16                             scCode;
  632.     SInt16                             reserved4;
  633.     SCCacheStatsRecPtr                 scCacheStatsPtr;
  634.     SInt16                             scCacheStatsReqSize;
  635.     SInt16                             scCacheStatsActSize;
  636. };
  637. typedef struct GetCacheStatsParam        GetCacheStatsParam;
  638. typedef GetCacheStatsParam *            GetCacheStatsParamPtr;
  639.  
  640. struct ResetCacheParam {
  641.     QElemPtr                         qLink;                        /*queue link in header*/
  642.     SInt16                             qType;                        /*type byte for safety check*/
  643.     SInt16                             ioTrap;                        /*FS: the Trap*/
  644.     Ptr                             ioCmdAddr;                    /*FS: address to dispatch to*/
  645.     SCCompletionUPP                 ioCompletion;                /*completion routine addr (0 for synch calls)*/
  646.     OSErr                             ioResult;                    /*result code*/
  647.     SInt32                             reserved;
  648.     SInt16                             reserved2;
  649.     SInt16                             reserved3;
  650.     SInt16                             scCode;
  651.     SInt16                             bitmap;
  652. };
  653. typedef struct ResetCacheParam            ResetCacheParam;
  654. typedef ResetCacheParam *                ResetCacheParamPtr;
  655. /* Used in extended user call if attrVersion is kOldUserAttrRecVersion... */
  656.  
  657. struct OldUserAttrRec {
  658.     SInt32                             scLoginTime;
  659.     SInt32                             scLastUseTime;
  660.     SInt32                             scSocketNum;
  661.     SInt16                             scConnectionType;
  662.     SInt16                             scDisconnectID;
  663. };
  664. typedef struct OldUserAttrRec            OldUserAttrRec;
  665.  
  666. typedef OldUserAttrRec *                OldUserAttrPtr;
  667. /* Used in extended user call if attrVersion is kUserAttrRecVersion... */
  668.  
  669. struct UserAttrRec {
  670.     SInt32                             scLoginTime;
  671.     SInt32                             scLastUseTime;
  672.     SInt32                             scSocketNum;
  673.     FourCharCode                     scProtocolType;                /* The Session Protocol, i.e. AFP, FTP, SMB */
  674.     FourCharCode                     scTransportType;            /* The Transport, i.e. ATP, TCP/IP */
  675.     StringPtr                         scSessionNamePtr;            /* Str63 */
  676.     SInt32                             scDisconnectID;
  677. };
  678. typedef struct UserAttrRec                UserAttrRec;
  679.  
  680. typedef UserAttrRec *                    UserAttrPtr;
  681.  
  682. struct ExtUserInfoParam {
  683.     QElemPtr                         qLink;                        /*queue link in header*/
  684.     SInt16                             qType;                        /*type byte for safety check*/
  685.     SInt16                             ioTrap;                        /*FS: the Trap*/
  686.     Ptr                             ioCmdAddr;                    /*FS: address to dispatch to*/
  687.     SCCompletionUPP                 ioCompletion;                /*completion routine addr (0 for synch calls)*/
  688.     OSErr                             ioResult;                    /*result code*/
  689.     StringPtr                         scNamePtr;
  690.     SInt16                             reserved2;
  691.     SInt16                             reserved3;
  692.     SInt16                             scCode;
  693.     SInt32                             scPosition;
  694.     SInt32                             scUNRecID;
  695.     SInt32                             scUserID;
  696.     SInt16                             attrVersion;
  697.     UserAttrPtr                     scUserAttrPtr;
  698. };
  699. typedef struct ExtUserInfoParam            ExtUserInfoParam;
  700. typedef ExtUserInfoParam *                ExtUserInfoParamPtr;
  701.  
  702. struct ServiceStateParam {
  703.     QElemPtr                         qLink;                        /*queue link in header*/
  704.     SInt16                             qType;                        /*type byte for safety check*/
  705.     SInt16                             ioTrap;                        /*FS: the Trap*/
  706.     Ptr                             ioCmdAddr;                    /*FS: address to dispatch to*/
  707.     SCCompletionUPP                 ioCompletion;                /*completion routine addr (0 for synch calls)*/
  708.     OSErr                             ioResult;                    /*result code*/
  709.     StringPtr                         reserved;
  710.     SInt16                             reserved2;
  711.     SInt16                             reserved3;
  712.     SInt16                             scCode;
  713.     SInt16                             afpTCPState;
  714.     SInt16                             httpState;
  715.     SInt16                             otherState;
  716.     SInt16                             multiHoming;
  717.     SInt16                             srvrUsageLimit;
  718. };
  719. typedef struct ServiceStateParam        ServiceStateParam;
  720. typedef ServiceStateParam *                ServiceStateParamPtr;
  721.  
  722. struct PlugInInfoParam {
  723.     QElemPtr                         qLink;                        /*queue link in header*/
  724.     SInt16                             qType;                        /*type byte for safety check*/
  725.     SInt16                             ioTrap;                        /*FS: the Trap*/
  726.     Ptr                             ioCmdAddr;                    /*FS: address to dispatch to*/
  727.     SCCompletionUPP                 ioCompletion;                /*completion routine addr (0 for synch calls)*/
  728.     OSErr                             ioResult;                    /*result code*/
  729.     SInt32                             reserved;
  730.     SInt16                             reserved2;
  731.     SInt16                             reserved3;
  732.     SInt16                             scCode;
  733.     SInt16                             version;
  734.     SInt32                             index;
  735.     UInt8                             error;
  736.     UInt8                             reserved4;
  737.     char                             name[32];
  738.     char                             versionStr[12];
  739.     char                             adminURL[256];
  740.     UInt32                             plugInAttributes;
  741.     SInt32                             plugInRef;
  742.     SInt16                             isLast;
  743. };
  744. typedef struct PlugInInfoParam            PlugInInfoParam;
  745. typedef PlugInInfoParam *                PlugInInfoParamPtr;
  746.  
  747. struct PlugInMimeTypeParam {
  748.     QElemPtr                         qLink;                        /*queue link in header*/
  749.     SInt16                             qType;                        /*type byte for safety check*/
  750.     SInt16                             ioTrap;                        /*FS: the Trap*/
  751.     Ptr                             ioCmdAddr;                    /*FS: address to dispatch to*/
  752.     SCCompletionUPP                 ioCompletion;                /*completion routine addr (0 for synch calls)*/
  753.     OSErr                             ioResult;                    /*result code*/
  754.     SInt32                             reserved;
  755.     SInt16                             reserved2;
  756.     SInt16                             reserved3;
  757.     SInt16                             scCode;
  758.     SInt16                             version;
  759.     SInt32                             plugInRef;
  760.     SInt32                             index;
  761.     UInt8                             error;
  762.     UInt8                             reserved4;
  763.     char                             mimetype[80];
  764.     char                             suffix[32];
  765.     OSType                             typeCode;
  766.     OSType                             creatorCode;
  767.     SInt16                             isLast;
  768. };
  769. typedef struct PlugInMimeTypeParam        PlugInMimeTypeParam;
  770. typedef PlugInMimeTypeParam *            PlugInMimeTypeParamPtr;
  771.  
  772. struct SetHistoryParam {
  773.     QElemPtr                         qLink;                        /*queue link in header*/
  774.     SInt16                             qType;                        /*type byte for safety check*/
  775.     SInt16                             ioTrap;                        /*FS: the Trap*/
  776.     Ptr                             ioCmdAddr;                    /*FS: address to dispatch to*/
  777.     SCCompletionUPP                 ioCompletion;                /*completion routine addr (0 for synch calls)*/
  778.     OSErr                             ioResult;                    /*result code*/
  779.     SInt32                             reserved;
  780.     SInt16                             reserved2;
  781.     SInt16                             historySampleTime;
  782.     SInt16                             scCode;
  783. };
  784. typedef struct SetHistoryParam            SetHistoryParam;
  785. typedef SetHistoryParam *                SetHistoryParamPtr;
  786.  
  787. struct HistoryData {
  788.     UInt8                             dpMin;
  789.     UInt8                             dpMax;
  790.     UInt8                             dpAverage;
  791.     UInt8                             filler;
  792. };
  793. typedef struct HistoryData                HistoryData;
  794.  
  795. struct ServerHistoryRec {
  796.     UInt32                             historySyncCount;
  797.     UInt32                             historyLastSample;
  798.     UInt16                             historySampleTime;
  799.     UInt16                             numDataPoints;
  800.     HistoryData                     dataPoint[1024];
  801. };
  802. typedef struct ServerHistoryRec            ServerHistoryRec;
  803.  
  804. typedef ServerHistoryRec *                ServerHistoryPtr;
  805.  
  806. struct GetHistoryParam {
  807.     QElemPtr                         qLink;                        /*queue link in header*/
  808.     SInt16                             qType;                        /*type byte for safety check*/
  809.     SInt16                             ioTrap;                        /*FS: the Trap*/
  810.     Ptr                             ioCmdAddr;                    /*FS: address to dispatch to*/
  811.     SCCompletionUPP                 ioCompletion;                /*completion routine addr (0 for synch calls)*/
  812.     OSErr                             ioResult;                    /*result code*/
  813.     ServerHistoryPtr                 scHistory;
  814.     SInt16                             numDataPointsRequested;
  815.     SInt16                             reserved2;
  816.     SInt16                             scCode;
  817. };
  818. typedef struct GetHistoryParam            GetHistoryParam;
  819. typedef GetHistoryParam *                GetHistoryParamPtr;
  820.  
  821. struct SMBConfigParam {
  822.     QElemPtr                         qLink;                        /*queue link in header*/
  823.     SInt16                             qType;                        /*type byte for safety check*/
  824.     SInt16                             ioTrap;                        /*FS: the Trap*/
  825.     Ptr                             ioCmdAddr;                    /*FS: address to dispatch to*/
  826.     SCCompletionUPP                 ioCompletion;                /*completion routine addr (0 for synch calls)*/
  827.     OSErr                             ioResult;                    /*result code*/
  828.     UInt32                             reserved;
  829.     UInt32                             reserved2;
  830.     SInt16                             scCode;
  831.     Boolean                         enabled;
  832.     UInt8                             reserved3;
  833.     Str63                             netBIOSName;
  834.     Str63                             workgroupName;
  835.     Str63                             comment;
  836.     Str63                             winsAddress;
  837. };
  838. typedef struct SMBConfigParam            SMBConfigParam;
  839. typedef SMBConfigParam *                SMBConfigParamPtr;
  840.  
  841. struct BlockUserRec {
  842.     Str32Field                         name;
  843.     UInt32                             recID;
  844.     UInt32                             id;
  845.     UInt32                             loginTime;
  846.     UInt32                             lastUseTime;
  847.     OSType                             serviceType;
  848.     OSType                             sessionType;
  849.     union {
  850.         AddrBlock                         at;
  851.         UInt32                             ip;                        /* #### Should be InetHost...*/
  852.     }                                 address;
  853. };
  854. typedef struct BlockUserRec                BlockUserRec;
  855.  
  856. typedef BlockUserRec *                    BlockUserPtr;
  857.  
  858. struct BlockUserRecParam {
  859.     QElemPtr                         qLink;                        /*queue link in header*/
  860.     SInt16                             qType;                        /*type byte for safety check*/
  861.     SInt16                             ioTrap;                        /*FS: the Trap*/
  862.     Ptr                             ioCmdAddr;                    /*FS: address to dispatch to*/
  863.     SCCompletionUPP                 ioCompletion;                /*completion routine addr (0 for synch calls)*/
  864.     OSErr                             ioResult;                    /*result code; -39 == more users than buffer*/
  865.     UInt32                             reserved;
  866.     UInt32                             reserved2;
  867.     SInt16                             scCode;
  868.     UInt32                             version;                    /* Should be kSCBlockGetUserRecVersion. */
  869.     UInt32                             numUsers;                    /* On input, size of buffer. On output, num users. */
  870.     BlockUserPtr                     users;                        /* Pointer to array of SUserRecs to be filled in by call. */
  871. };
  872. typedef struct BlockUserRecParam        BlockUserRecParam;
  873. typedef BlockUserRecParam *                BlockUserRecParamPtr;
  874.  
  875. union SCParamBlockRec {
  876.     StartParam                         startParam;
  877.     DisconnectParam                 disconnectParam;
  878.     PollServerParam                 pollServerParam;
  879.     StandardParam                     standardParam;
  880.     SetupParam                         setupParam;
  881.     StatusParam                     statusParam;
  882.     ServerEventParam                 serverEventParam;
  883.     VersionParam                     versionParam;
  884.     UserInfoParam                     userInfoParam;
  885.     VolMountedParam                 volMountedParam;
  886.     GetCacheStatsParam                 getCacheStatsParam;
  887.     ResetCacheParam                 resetCacheParam;
  888.     ExtUserInfoParam                 extUserInfoParam;
  889.     ServiceStateParam                 serviceStateParam;
  890.     PlugInInfoParam                 plugInInfoParam;
  891.     PlugInMimeTypeParam             plugInMimeTypeParam;
  892.     SetHistoryParam                 setHistoryParam;
  893.     GetHistoryParam                 getHistoryParam;
  894.     SMBConfigParam                     smbConfigParam;
  895.     BlockUserRecParam                 blockGetUserParam;
  896. };
  897. typedef union SCParamBlockRec            SCParamBlockRec;
  898.  
  899. typedef SCParamBlockRec *                SCParamBlockPtr;
  900. /* 68K Trap Interface ------------------------------------------------------------------------------ */
  901.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  902.                                                                                             #pragma parameter __D0 ServerDispatchSync(__A0)
  903.                                                                                             #endif
  904. EXTERN_API( OSErr )
  905. ServerDispatchSync                (SCParamBlockPtr         paramBlock)                            TWOWORDINLINE(0x7000, 0xA094);
  906.  
  907. /* Note: there is no ServerDispatchAsync! */
  908. /* Gestaltage -------------------------------------------------------------------------------------- */
  909.  
  910. enum {
  911.     gestaltASIPFSVersion        = FOUR_CHAR_CODE('#!#7')        /* Defined only from 6.0... */
  912. };
  913.  
  914. /* Server Event Detail ----------------------------------------------------------------------------- */
  915.  
  916. /*
  917.    Bit names for the serverEventMask field of ServerEventQEntry; event numbers returned in
  918.    ServerEventRecord... 
  919. */
  920. enum {
  921.     kSCStartAFPRequestEvt        = 0,                            /* also set afpCommandMask for these */
  922.     kSCSendAFPResponseEvt        = 1
  923. };
  924.  
  925. enum {
  926.     kSCServerControlCallEvt        = 4                                /* also set serverControlMask for this */
  927. };
  928.  
  929. enum {
  930.     kSCServerBusyEvt            = 2,
  931.     kSCServerShutdownEvt        = 3,
  932.     kSCShareEvt                    = 5,
  933.     kSCUnShareEvt                = 6,
  934.     kSCSetDirAccessEvt            = 7,
  935.     kSCServerNameChangeEvt        = 8,
  936.     kSCVolumePrepEvt            = 9,
  937.     kSCVolumeUnmountEvt            = 10,
  938.     kSCServerStartupEvt            = 11,
  939.     kSCSessionTornDownEvt        = 12,
  940.     kSCOutOfSequenceEvt            = 13,
  941.     kSCWksClosedSessionEvt        = 14,
  942.     kSCSessionTimedOutEvt        = 15,
  943.     kSCSrvrClosedSessionEvt        = 16,
  944.     kSCExtendedServerEvtRec        = 31
  945. };
  946.  
  947. /* Maximum size of the Buffer in the ServerEventRecord... */
  948. enum {
  949.     kBufferMax                    = 48
  950. };
  951.  
  952.  
  953. struct IPBlock {
  954.     UInt8                             part[4];
  955. };
  956. typedef struct IPBlock                    IPBlock;
  957.  
  958. union UserAddress {
  959.     UInt32                             wholeAddress;
  960.     AddrBlock                         appleTalkAddress;
  961.     IPBlock                         ipAddress;
  962. };
  963. typedef union UserAddress                UserAddress;
  964.  
  965. struct ServerEventRecord {
  966.     SInt32                             eventNumber;
  967.     UInt32                             serverTimeInSeconds;
  968.     SInt16                             result;
  969.     SInt16                             bufferSize;
  970.     char                             buffer[48];
  971.     Str31                             nameStr;
  972.     SInt16                             afpCommand;
  973.     SInt32                             sessionID;
  974.     SInt32                             userID;
  975.     Str31                             userName;
  976.     SInt16                             vRefNum;
  977.     SInt32                             dirID;
  978.     UserAddress                     addr;
  979. };
  980. typedef struct ServerEventRecord        ServerEventRecord;
  981. /* For annexVersion field; set by server to indicate version of record... */
  982. enum {
  983.     kServerEventAnnexVersion6    = 0x06000000
  984. };
  985.  
  986.  
  987. struct ExtendedServerEventRecord {
  988.     SInt32                             eventNumber;
  989.     UInt32                             serverTimeInSeconds;
  990.     SInt16                             result;
  991.     SInt16                             bufferSize;
  992.     char                             buffer[48];
  993.     Str31                             nameStr;
  994.     SInt16                             afpCommand;
  995.     SInt32                             sessionID;
  996.     SInt32                             userID;
  997.     Str31                             userName;
  998.     SInt16                             vRefNum;
  999.     SInt32                             dirID;
  1000.     UserAddress                     addr;
  1001.     FourCharCode                     transportType;
  1002.     UInt32                             annexVersion;
  1003. };
  1004. typedef struct ExtendedServerEventRecord ExtendedServerEventRecord;
  1005. typedef struct ServerEventQEntry         ServerEventQEntry;
  1006.  
  1007. typedef ServerEventQEntry *                ServerEventQEntryPtr;
  1008. typedef CALLBACK_API( void , ServerEventHandlerProcPtr )(ServerEventQEntryPtr entry, ExtendedServerEventRecord *event);
  1009. typedef STACK_UPP_TYPE(ServerEventHandlerProcPtr)                 ServerEventHandlerUPP;
  1010.  
  1011. struct ServerEventQEntry {
  1012.     ServerEventQEntryPtr             next;
  1013.     SInt16                             queuetype;
  1014.     ServerEventHandlerUPP             callBack;
  1015.     SInt32                             serverEventMask;
  1016.     SInt32                             afpCommandMask[2];
  1017.     SInt32                             serverControlMask;
  1018. };
  1019.  
  1020. #if OPAQUE_UPP_TYPES
  1021.     EXTERN_API(ServerEventHandlerUPP)
  1022.     NewServerEventHandlerUPP       (ServerEventHandlerProcPtr userRoutine);
  1023.  
  1024.     EXTERN_API(void)
  1025.     DisposeServerEventHandlerUPP    (ServerEventHandlerUPP    userUPP);
  1026.  
  1027. #else
  1028.     enum { uppServerEventHandlerProcInfo = 0x000003C0 };             /* pascal no_return_value Func(4_bytes, 4_bytes) */
  1029.     #define NewServerEventHandlerUPP(userRoutine)                     (ServerEventHandlerUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppServerEventHandlerProcInfo, GetCurrentArchitecture())
  1030.     #define DisposeServerEventHandlerUPP(userUPP)                     DisposeRoutineDescriptor(userUPP)
  1031. #endif
  1032. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  1033. #define NewServerEventHandlerProc(userRoutine)                     NewServerEventHandlerUPP(userRoutine)
  1034. /* ------------------------------------------------------------------------------------------------- */
  1035.  
  1036. #if PRAGMA_STRUCT_ALIGN
  1037.     #pragma options align=reset
  1038. #elif PRAGMA_STRUCT_PACKPUSH
  1039.     #pragma pack(pop)
  1040. #elif PRAGMA_STRUCT_PACK
  1041.     #pragma pack()
  1042. #endif
  1043.  
  1044. #ifdef PRAGMA_IMPORT_OFF
  1045. #pragma import off
  1046. #elif PRAGMA_IMPORT
  1047. #pragma import reset
  1048. #endif
  1049.  
  1050. #ifdef __cplusplus
  1051. }
  1052. #endif
  1053.  
  1054. #endif /* __APPLESHAREFILESERVERCONTROL__ */
  1055.  
  1056.